{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "C:\\Users\\yzpang\\Desktop\\DEV\\study\\Python\\pythonProject\\base\\模块\\os\n"
     ]
    }
   ],
   "source": [
    "# 获取当前工作目录\n",
    "import os\n",
    "\n",
    "current_directory = os.getcwd()\n",
    "\n",
    "print(current_directory)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['os', 'subprocess', '模块.ipynb']\n"
     ]
    }
   ],
   "source": [
    "# 列出指定目录文件\n",
    "dirs = os.listdir(\".\")\n",
    "print(dirs)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "C:\\Users\\yzpang\\Desktop\\DEV\\study\\Python\\pythonProject\\base\\模块\n"
     ]
    }
   ],
   "source": [
    "# 变更当前工作目录\n",
    "target_directory = \"../\"\n",
    "os.chdir(target_directory)\n",
    "\n",
    "current_directory = os.getcwd()\n",
    "\n",
    "print(current_directory)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}